#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int digitNum(int num)
{
	int digit = 1;

	num = num/10;

	while(num)
	{
		digit ++;
		num = num/10;
	}

	return digit;
}

/*int pow(int a, int b)
{
	int output = 1;
	if (a == 0 && bb == 0)
		return -1;
	if b == 0
		return 1;
	while(b)
	{	
		output *= a;
		b--; 
	} 
	return output

}*/
int inverseNum(int num)
{
	int digit = digitNum(num);
	int bit = 0;
	int beishu = 10;
	int output = 0;
	for(int i = 0; i < digit; i++)
	{
		
		output += (num % 10)* pow(10,digit - i -1);
		beishu *= 10; 
		num /= 10; 
	}

	return output;
}

int main(int argc, char const *argv[])
{
	int a[5] = {3,10,111,12434343,1243421};
	for (int i = 0; i < 5; ++i)
	{
		printf(" %d ---> %d\n", a[i], inverseNum(a[i]));
	}
	return 0;
}